package com.icss.train_sys_back.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author wk
 * @desc 全局配置类
 * @date 2025/9/5 13:47
 */
@Configuration //表示当前类是一个配置类
public class AppConfig implements WebMvcConfigurer {

    //配置视图统一跳转
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //addViewController:浏览器访问的路径(http://localhost:8080/home/login.html)
        //setViewName:实际访问路径，要给指定的名称添加前缀(templates)和后缀(.html)   /templates/home/login.html
//        registry.addViewController("/home/login.html").setViewName("/home/login");
//        registry.addViewController("/home/login").setViewName("/home/login");
//        registry.addViewController("/home/index.html").setViewName("/home/index");
//        registry.addViewController("/home/index").setViewName("/home/index");
//        registry.addViewController("/system/index.html").setViewName("/admin/system/index");
//        registry.addViewController("/home/header.html").setViewName("/home/header");
//
//
//        registry.addViewController("/header.html").setViewName("/admin/common/header");
//        registry.addViewController("/header-menu.html").setViewName("/admin/common/header-menu");
//        registry.addViewController("/footer.html").setViewName("/admin/common/footer");

    }
}
